<script setup>
import { computed, ref } from "vue";
import { useStore } from "vuex";

import { useRouter } from "vue-router";
const router = useRouter();
const store = useStore();
//   返回
const onClickLeft = () => history.back();
const gomsxq = async(id) => {
  await store.commit('jiaoshi/SET_LISTXQ',id)
  router.push('/jsxq');
};



let jiaoshiList = computed(() => store.state.jiaoshi.list);
</script>

<template>
  <van-nav-bar title="名师推荐" left-arrow @click-left="onClickLeft" />
  <div class="box">
    <van-card
      v-for="(item , index) in jiaoshiList"
      :key="index"
      @click="gomsxq(item._id)"
      :title="item.name"
      :thumb="item.avatar"

    >
      <template #desc>
        <div class="mstj-box">
          <div>毕业学校:{{graduationSch}}</div>
          <div>学历:{{item.edu}}</div>
          <div>授课年级:{{item.class}}</div>
        </div>
      </template>
    </van-card>
  </div>
</template>



<style  scoped>
.box {
  margin-top: 10px;
}
.mstj-box > div {
  color: darkgray;
  padding: 3px 0;
}
</style>